@extends('layouts.app')

@section('title','mVideoList')

@section('content')
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <header class="list-header">
                    <section>大师视频列表</section>
                    <section>
                        <a type="submit" href="{{ route('mvideo.create') }}" class="add">
                            <i class="fa fa-plus-circle fa-lg" aria-hidden="true"></i>&nbsp;添加大师视频
                        </a>
                    </section>
                </header>

                <table class="table table-hover table-striped list-table">
                    <tr class="list-table-tr">
                                <th>视频名称</th>
                                <th>视频图片</th>
                                <th>视频简介</th>
                                <th>视频评价</th>
                                <th>视频地址</th>
                                <th>创建时间</th>
                                <th class="text-right">操作</th>
                            </tr>

                            @foreach($mvideos as $v)
                                <tr>
                                    <td>{{ $v->video_name }}</td>
                                    <td> <img src="/uploads/video_pic/{{ $v->video_pic }}" width="50px"/></td>
                                    <td>{{ $v->video_intro }}</td>
                                    <td>{{ $v->video_likes }}</td>
                                    <td>{{ $v->video_address }}</td>
                                    <td>{{ $v->created_at }}</td>
                                    <td class="text-right">
                                        <button class="delete" data-toggle="modal" data-target="#deleteModel"><i class="fa fa-trash-o fa-lg" aria-hidden="true"></i></button>
                                    </td>
                                </tr>
                                <div class="modal fade bs-example-modal-sm" id="deleteModel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                                    <div class="modal-dialog modal-sm" role="document">
                                        <div class="modal-content">
                                            <div class="modal-header">
                                                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                                <h4 class="modal-title" id="myModalLabel">确定删除吗？</h4>
                                            </div>
                                            <div class="modal-footer">
                                                <div class="btn-group btn-group-justified" role="group" aria-label="group button">
                                                    <div class="btn-group" role="group">
                                                        <form action="{{ URL('admin/mvideo/'.$v->id) }}" method="POST" style="display: inline;">
                                                            <input name="_method" type="hidden" value="DELETE">
                                                            <input type="hidden" name="_token" value="{{ csrf_token() }}">
                                                            <button type="submit" class="btn btn-default">确定</button>
                                                        </form>
                                                    </div>
                                                    <div class="btn-group" role="group">
                                                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            @endforeach
                        </table>
                        <hr>
                        {!! $mvideos->render() !!}
                    </div>
                </div>
            </div>

@endsection